#-*- coding:gbk -*-
'''
Created on 2012-7-23

@author: xxy
'''
import world_object

class Unit(world_object.WorldObject):
    def __init__(self, name, guid = None, hit_flag = True):
        world_object.WorldObject.__init__(self, name, guid)
        self.m_basic_physical_attack = 0
        self.m_basic_magic_attack = 0
        self.m_basic_physical_defence = 0
        self.m_basic_magic_defence = 0
        self.m_basic_speed = 0
        self.m_basic_attack_distance = 0
        self.m_basic_attack_period = 0
        self.m_basic_hp = 0
        self.m_basic_mp = 0
        self.m_experience = 0
        self.m_level = 1
        self.m_dead = 0
        self.m_kill = 0
        self.m_hit_flag = hit_flag
        self.m_current_hp = 0
        self.m_current_mp = 0
        self.m_state = ()
        
        
    def setState(self, state):
        self.m_state = state
        
    def getState(self):
        return self.m_state
        
    def getPhyAttack(self):
        return self.m_basic_physical_attack
    
    def getMagAttack(self):
        return self.m_basic_magic_attack
    
    def getPhyDefence(self):
        return self.m_basic_physical_defence
    
    def getMagDefence(self):
        return self.m_basic_magic_defence
    
    def getSpeed(self):
        return self.m_basic_speed
    
    def getAttackDistance(self):
        return self.m_basic_attack_distance
    
    def getAttackPeriod(self):
        return self.m_basic_attack_period
    
    def getHp(self):
        return self.m_basic_hp
    
    def getMp(self):
        return self.m_basic_mp
    
    def getBasicHp(self):
        return self.m_basic_hp
    
    def setCurrentMp(self, mp):
        self.m_current_mp = mp
        
    def getCurrentMp(self):
        return self.m_current_mp
    
    def setCurrentHp(self, hp):
        self.m_current_hp = hp
    
    def getCurrentHp(self):
        return self.m_current_hp
    
    def getHitFlag(self):
        return self.m_hit_flag
    
    def getKill(self):
        return self.m_kill
    
    def getDead(self):
        return self.m_dead
    
    def updateKill(self):
        self.m_kill += 1
        
    def updateDead(self):
        self.m_dead += 1